<head>
    <link href="${ctx}/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
    <link href="${ctx}/font-awesome/3.0.0/css/font-awesome.min.css" rel="stylesheet">
    <link href="${ctx}/css/index.css" rel="stylesheet">
    <link href="${ctx}/bootstrap-table/1.12.0/bootstrap-table.min.css" rel="stylesheet">
    <script src="${ctx}/jquery/2.1.4/jquery.min.js"></script>
    <script src="${ctx}/bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <script src="${ctx}/bootstrap-table/1.12.0/bootstrap-table.min.js"></script>
    <script src="${ctx}/bootstrap-table/1.12.0/locale/bootstrap-table-zh-CN.min.js"></script>
    <script src="${ctx}/bootstrap-table/1.12.0/extensions/export/bootstrap-table-export.min.js"></script>
    <script src="${ctx}/js/extends.js"></script>
    <script src="${ctx}/layui/layui.all.js"></script>
    <script src="${ctx}/js/util.js"></script>
    <link href="${ctx}/layui/css/layui.css" rel="stylesheet">
</head>
<title>数据源排序分页</title>
<div class="lay-box">

    <span onclick="search()" class="btn btn-info" style="height: 38px;margin-left: 10px;font-size: 14px">刷新</span>

    <table class="table table-border table-bordered table-hover table-bg table-sort" id="layTable"
           lay-filter="tableFilter">

    </table>
</div>

<style>
    .lay-box {
        padding: 8px 12px;
    }

    .layui-form-checkbox[lay-skin=primary] i {
        top: 5px;
    }
</style>


<script type="text/javascript">
    var startDate = "";
    var endDate = "";
    var searchKey = "";
    var tableIns;
    var ids = "";
    var form;
    var table = "app_ad_contro";
    layui.use('table', function () {
        tableIns = layui.table,
            form = layui.form;
        form.render();
        tableIns.render({
            elem: '#layTable'
            ,
            url: '/sys/appadcontro/data'
            ,
            method: 'POST'
            ,
            where: {
                table: table,
                query: {},
                time: {'start': startDate, 'end': endDate},
                key: {'': ''}
            }
            ,
            id: 'dataTableId'
            ,
            cols: [[
                {
                    field: 'task_name',
                    title: '数据源名称',
                    width: 150,
                    align: 'center',
                    sort: true
                }, {

                    title: '展现次数 今日   /   昨天',
                    width: 300,
                    align: 'center',
                    sort: true,
                    templet: function (data) {
                        return '<span style="color: blue">' + data.today + '</span>' + "   /   " + '<span style="color: red">' + data.yeterday + '</span>';
                    }
                }
                , {

                    title: '每日必赚成功 今日   /   昨天',
                    width: 300,
                    align: 'center',
                    sort: true,
                    templet: function (data) {
                        return '<span style="color: blue">' + data.success_today + '</span>' + "   /   " + '<span style="color: red">' + data.success_yeterday + '</span>';
                    }
                }


            ]]
            ,
            page: false
        });


    });

    function search() {

        tableIns.reload('dataTableId', {
            where: {}
            , page: {}
        });
    }


    function showmsg(msg) {
        layer.msg(msg)
    }


</script>
<!--/请在上方写此页面业务相关的脚本-->
